package com.atguigu.exercise4;

/**
 * @author : leimingchao
 * @date Date : 2021年08月18日 21:03
 */
public class Account {

    private double balance;

    public Account() {
    }

    public Account(double inti_balance) {
        this.balance = inti_balance;
    }

    public double getBalance() {
        return balance;
    }

    public void deposit(double amt) {
        if (amt > 0) {
            balance +=amt;
            System.out.println("存钱成功");
        }
    }

    public void withdraw(double amt) {
        if (balance >= amt) {
            balance -= amt;
            System.out.println("取钱成功");
        } else {
            System.out.println("余额不足");
        }
    }
}
